home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp48_2
/
to.prg
< prev
next >
Wrap
Text File
|
1995-03-23
|
4KB
|
132 lines
Article 1752 of comp.sys.handhelds:
Path: en.ecn.purdue.edu!noose.ecn.purdue.edu!samsung!zaphod.mps.ohio-state.edu!wuarchive!cs.utexas.edu!helios!tamuts!n233dk
From: n233dk@tamuts.tamu.edu (Rick Grevelle)
Newsgroups: comp.sys.handhelds
Subject: ->PRG & PRG-> RPL Versions
Message-ID: <8979@helios.TAMU.EDU>
Date: 11 Oct 90 04:22:28 GMT
References: <9010102226.AA14984@CS.ORST.EDU> <34739@cup.portal.com>
Sender: usenet@helios.TAMU.EDU
Organization: Texas A&M University
Lines: 117
In article <3464@mindlink.UUCP> a634@mindlink.UUCP (Rob Prior) writes:
>I remember there being a couple of programs for my 28s called PRG-> and ->PRG.
>They functioned as follows:
>
>on the stack:
>
>4:
>3:
>2:
>1: << RCL DUP PURGE >> (or whatever)
>
>PRG-> executed would give:
>
>6: <<
>5: RCL
>4: DUP
>3: PURGE
>2: >>
>1: 5 (this all being accomplished
> through the use of sysevals)
>
>->PRG would take the stack in part 2 and give you what you started with. After
>all, we can get all of the symbols (<<, >>, RCL, etc.) onto the stack with
>sysevals. Is there a way to implement the same programs on the 48sx? If
>someone could post their solution, it would be muchly appreciated.
>
>Thanks in advance,
>Rob
With all of the machine patching routines that have been posted, I incorrectly
assumed everyone already knew what it was I was doing. Thanks for asking the
question; eventhough there are apparently those who have yet to see the value
of such a command, I'm quite sure there are others who would like to have this
highly convenient tool at their disposal. Why HP left this command out of the
OBJ-> command is a mystery to me.
054AF list->, algebraic->, program->
05445 ->program
05459 ->list
0546D ->algebraic
These SYSEVALs do no argument checking and could be potentially dangerous if
misused. To alleviate this I've included two short routines which will create
versions of ->PRG and PRG-> that will do the necessary argument checking. For
the reason that these routines are of a relatively short size of, I see no need
for posting an encoded version. RPL disassemblies are included for clarity.
CPRG->
(BYTES: #46D6h 82.5)
%%HP: T(3)A(D)F(.);
\<<
# F18FB218AB202D9Dh
# 312B1C9730403h
# 5193h SYSEVAL
# 4003h SYSEVAL
# 62B9Ch SYSEVAL
\>>
PRG->
02D9D begin RPL
18AB2 need one argument from stack
18FB2 check one argument for type
0403F short integer <8h>, program
1C973 program->
0312B end
C->PRG
(BYTES: #D79h 82.5)
%%HP: T(3)A(D)F(.);
\<<
# B0544518C3402D9Dh
# 312h # 5193h
SYSEVAL # 4003h
SYSEVAL 62B9Ch
SYSEVAL
\>>
->PRG
02D9D begin RPL
18C34 need n arguments from stack
05445 ->program
0312B end
For PRG-> I prefer to use the two prefixed machine routines # 18AB2h and
# 18FB2h, rather than # 18ECEh, for the reason they don't give all of the
added garbage in the error message. The only disadvantage is it takes
two of them to do what # 18ECEh does alone.
As for as the ->PRG routine is concerned, I've yet to find a more suitable
address for checking in this situation. The error message it returns will
contain the extraneous information "XLIB 25 45" before the actual message.
One final note; both routines here will be created without their user program
delimiters. If for some reason this is annoys you, ->PRG and PRG-> can be
used to to install the missing delimiters. The two routines can also be used
to remove delimiters from programs as well. Be carefull though, there are
actually three sets of these delimiters used by the 48, two of which are used
for nesting routines within programs. You could alter the intended results.
Rick Grevelle